<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Xenon Boostrap Admin Panel" />
    <meta name="author" content="" />

    <title>校园e商</title>

*{<link rel="stylesheet" href="http://fonts.useso.com/css?family=Arimo:400,700,400italic">}*
    <link rel="stylesheet" href="/public/css/fonts/linecons/css/linecons.css">
    <link rel="stylesheet" href="/public/css/fonts/fontawesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/public/css/bootstrap.css">
    <link rel="stylesheet" href="/public/css/xenon-core.css">
    <link rel="stylesheet" href="/public/css/xenon-forms.css">
    <link rel="stylesheet" href="/public/css/xenon-components.css">
    <link rel="stylesheet" href="/public/css/xenon-skins.css">
    <link rel="stylesheet" href="/public/css/custom.css">

    <script src="/public/js/jquery-1.11.1.min.js"></script>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <script src="/public/js/toastr/toastr.min.js"></script>
    <script>
        $(function () {
            var operateType = $('#idOperateType').val();

            if(operateType == 'SYSTEM'){
                $('input').attr('required',false);
                $('input').attr('readonly',true);
//                $('select').attr('disabled',true);
            }
        })

        //提交保存数据
        function submitOperate() {
            //因为disabled属性不会传递数据,所以提交数据之前去掉disabled属性以传递数据
            $('select').removeAttr('disabled');
            $('#operateForm').submit();

        }
    </script>

</head>
<body class="page-body" style="background: #ffffff;">
<div class="panel panel-default">
    <div class="panel-body">
        <form id="operateForm" method="POST" role="form" action="/power/admin/AdminBusinessCtrl/saveBusinessOperate" enctype="multipart/form-data" class="form-horizontal validate">
            <input type="hidden" name="operate.id" value="${operate?.id}">
            <input type="hidden" name="operate.business.id" value="${businessId}">
            <input type="hidden" name="pageNumber" value="${pageNumber}">
            <div class="form-group">
                <label class="col-sm-2 control-label" for="idName">操作名称</label>

                <div class="col-sm-10">
                    <input id="idName" type="text" name="operate.name" class="form-control" placeholder="请输入操作名称"
                           data-validate="required" value="${operate?.name}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="idFilterKey">过滤关键字</label>

                <div class="col-sm-10">
                    <input id="idFilterKey" type="text" name="operate.filterKey" class="form-control" placeholder="请输入过滤关键字"
                           data-validate="required"  value="${operate?.filterKey}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="idOperateType">操作类型</label>

                <div class="col-sm-10">
                    <select class="form-control" name="operate.operateType" id="idOperateType" placeholder="" disabled="true" readonly="true">
                        *{<option value="" #{if operate?.operateType == null } selected="true"#{/if} >---请选择---</option>}*
                        <option value="CUSTOM" #{if operate?.operateType == models.admin.enums.OperateType.CUSTOM } selected="true"#{/if} >自定义</option>
                        <option value="SYSTEM" #{if operate?.operateType == models.admin.enums.OperateType.SYSTEM } selected="true"#{/if} >系统默认</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="field-5"></label>

                <div class="col-sm-10">
                    <button type="button" onclick="submitOperate()" class="btn btn-success">&nbsp;&nbsp;确定&nbsp;&nbsp;</button>
                    <button type="reset" class="btn btn-white">&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
                </div>

            </div>

        </form>
    </div>
</div>

<!-- Imported styles on this page -->
<link rel="stylesheet" href="/public/js/wysihtml5/src/bootstrap-wysihtml5.css">
<link rel="stylesheet" href="/public/js/uikit/vendor/codemirror/codemirror.css">
<link rel="stylesheet" href="/public/js/uikit/uikit.css">
<link rel="stylesheet" href="/public/js/uikit/css/addons/uikit.almost-flat.addons.min.css">
<script src="/public/js/wysihtml5/lib/js/wysihtml5-0.3.0.js"></script>
<!-- Imported scripts on this page -->
<script src="/public/js/wysihtml5/src/bootstrap-wysihtml5.js"></script>
<script src="/public/js/uikit/vendor/codemirror/codemirror.js"></script>
<script src="/public/js/uikit/vendor/marked.js"></script>
<script src="/public/js/uikit/js/uikit.min.js"></script>
<script src="/public/js/uikit/js/addons/htmleditor.min.js"></script>
<script src="/public/js/ckeditor/ckeditor.js"></script>
<script src="/public/js/ckeditor/adapters/jquery.js"></script>

<!-- Imported scripts on this page -->
<script src="/public/js/jquery-validate/jquery.validate.min.js"></script>


<!-- Bottom Scripts -->
<script src="/public/js/bootstrap.min.js"></script>
<script src="/public/js/TweenMax.min.js"></script>
<script src="/public/js/resizeable.js"></script>
<script src="/public/js/joinable.js"></script>
<script src="/public/js/xenon-api.js"></script>
<script src="/public/js/xenon-toggles.js"></script>


<!-- Imported scripts on this page -->
<script src="/public/js/xenon-widgets.js"></script>
<script src="/public/js/devexpress-web-14.1/js/globalize.min.js"></script>
<script src="/public/js/devexpress-web-14.1/js/dx.chartjs.js"></script>


<!-- JavaScripts initializations and stuff -->
<script src="/public/js/xenon-custom.js"></script>

</body>
</html>